﻿<%@ Page Language="C#" MasterPageFile="~/MasterPage.master" AutoEventWireup="true" Inherits="Nivdal.UserLogins" Title="User logins - Nivdal.com"
    StylesheetTheme="SkinFile" Codebehind="UserLogins.aspx.cs" %>

<asp:Content ID="Content1" ContentPlaceHolderID="HeadPlaceHolder" runat="Server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="Server">
    <div class="basic_element">
    <div class="red_title">
       <asp:Label ID="Label1" runat="server" Text="User logins" CssClass="white_title"></asp:Label>
    </div>
    <div class="padding5">

        <asp:GridView  ID="GridView1" AllowPaging="True" PageSize="50"
            runat="server" SkinID="BigProfessional" DataSourceID="UserLoginsDataSourse" AutoGenerateColumns="False">
            <PagerSettings FirstPageText="<%$ Resources:Resource, FirstPage %>" LastPageText="<%$ Resources:Resource, LastPage %>"
                    Mode="NumericFirstLast" PageButtonCount="10" Position="Bottom" />
                <PagerStyle CssClass="pagination" HorizontalAlign="Center" />
            <Columns>
                <asp:TemplateField HeaderText="Username" ItemStyle-Width="15%">
                    <ItemTemplate>
                        <asp:HyperLink ID="UserHyperlink" runat="server" SkinID="BlackHyperLinkSkin" Text='<%# Eval("PublicName") %>'
                            NavigateUrl='<%# Eval("UserId","~/UserPage.aspx?Id={0}") %>'></asp:HyperLink>
                    </ItemTemplate>
                </asp:TemplateField>
                <asp:TemplateField HeaderText="Team name" ItemStyle-Width="20%">
                    <ItemTemplate>
                        <asp:Label ID="TeamNameLabel" runat="server" Text='<%# Eval("TeamName") + " (inactive)" %>'
                            SkinID="GridLabel" Visible='<%# (decimal)Eval("TeamId") == 0 %>'></asp:Label>
                        <asp:HyperLink ID="TeamHyperlink" runat="server" Text='<%# Eval("TeamName") %>' SkinID="BlackHyperLinkSkin"
                            NavigateUrl='<%# "~/TeamHomePage.aspx?TeamId=" + Eval("TeamId") %>' Visible='<%# (decimal)Eval("TeamId") != 0 %>'></asp:HyperLink>
                    </ItemTemplate>
                </asp:TemplateField>
                <asp:TemplateField HeaderText="e-mail" ItemStyle-Width="25%">
                    <ItemTemplate>
                        <asp:Label ID="EmailLabel" runat="server" Text='<%# Eval("email") %>' SkinID="GridLabel"></asp:Label>
                    </ItemTemplate>
                </asp:TemplateField>
                <asp:TemplateField HeaderText="Last login" ItemStyle-Width="15%">
                    <ItemTemplate>
                        <asp:Label ID="DateLabel" runat="server" Text='<%# Eval("LastLogin") %>' SkinID="GridLabel"></asp:Label>
                    </ItemTemplate>
                </asp:TemplateField>
                <asp:TemplateField HeaderText="Last week #" ItemStyle-Width="15%">
                    <ItemTemplate>
                        <asp:Label ID="LoginsLastWeekLabel" runat="server" Text='<%# Eval("LoginsLastWeek") %>'
                            SkinID="GridLabel"></asp:Label>
                    </ItemTemplate>
                </asp:TemplateField>
                <asp:TemplateField HeaderText="IP" ItemStyle-Width="20%">
                    <ItemTemplate>
                        <asp:Label ID="IPLabel" runat="server" Text='<%# Eval("IP") %>' SkinID="GridLabel"></asp:Label>
                    </ItemTemplate>
                </asp:TemplateField>
            </Columns>
        </asp:GridView>
        <asp:SqlDataSource ID="UserLoginsDataSourse" runat="server" ConnectionString="<%$ ConnectionStrings:ConnectionString %>"
            SelectCommand="Nivdal_GetUserLogins" SelectCommandType="StoredProcedure"></asp:SqlDataSource>
            
    </div>
    </div>
</asp:Content>
<asp:Content ID="Content3" ContentPlaceHolderID="PageNamePlaceHolder" runat="Server">
    <asp:Label ID="PageNameLabel" runat="server" Text="Admin >> user logins" CssClass="PageNameContentStyle"></asp:Label>
</asp:Content>
